<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*,java.util.*,vo.*,utils.*,impl.*"%>
<%
	if(session.getAttribute("userId")==null){
		response.sendRedirect("/");
		return;
	}
boolean isInputPeople=false;	
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>大连安瑞办公系统 v0.1.0</title>

<style type="text/css">
	@import "../dojo/dijit/themes/tundra/tundra.css";		
	table{margin:0px;padding:0px;border:0;}
		
	.tundra .dijitTitlePaneContentInner {
	padding:0px;
	}
	
	a.menu{
		font-size:12px;
		color:#000000;
		text-decoration:none;
	}
	a.menu:hover{
		text-decoration:underline;
		color:#ff0000;	
	}
</style>
<script language="javascript" src="../dojo/dojo/dojo.js" djConfig="parseOnLoad: true, isDebug: false"></script>
<script language="JavaScript" type="text/javascript" src="/main/main.js"></script>
<script language="javascript" src="/script/saveLogin.js"></script>
<script>
//保存登陆信息
 var tempArr=new Array("username","<%=session.getAttribute("userName")%>");
 saveLoginInfo(tempArr); 
</script>

<link href="../css/arg.css" rel="stylesheet" type="text/css">
</head>

<body class="tundra" topmargin="0" leftmargin="0">
<div dojoType="dijit.layout.LayoutContainer"
	style="width: 100%; height: 100%; "
>	
	<div dojoType="dijit.layout.ContentPane" layoutAlign="top" style="height:50px ">
		<table width="100%" height="50px" bgcolor="#ffffff" cellpadding="0" cellspacing="0" style="background-repeat:no-repeat" background="../img/top1.jpg">
			<tr>
				<td style="border-bottom:solid 1px #666666" align="left" valign="bottom">&nbsp;
					
				</td>
				<td style="border-bottom:solid 1px #666666" align="right" valign="bottom">
					欢迎 <%=session.getAttribute("userName")%> 登陆本系统&nbsp;&nbsp;
					<img src="/images/icon_home.gif" width="16" height="16" hspace="3"><a href="/main/login/main.htm" target="_parent">首页</a>&nbsp;&nbsp;
					<img src="/images/icon_calc.gif" width="16" height="16" hspace="3"><a href="#" onClick="openwin('/main/calc.htm','calc',350,200,400,260)">计算器</a>&nbsp;&nbsp;
					<img src="/images/icon_exit.gif" width="16" height="16" hspace="3"><a href="#" onClick="exitSys();">退出</a>&nbsp;&nbsp;
				
				</td>
			</tr>
		</table>
	</div>
	<div dojoType="dijit.layout.SplitContainer"
		orientation="horizontal"
		sizerWidth="7"
	 	layoutAlign="client"
		activeSizing="true"
	>	
		<div id="menuMain" dojoType="dijit.layout.AccordionContainer" duration="200"
			sizeShare="25"
		>
			<%
			//System.out.println("1");
				LoginBO bo=new LoginBO();
				List list=bo.queryThisRights(new Integer((String)session.getAttribute("userId")));
				AgrRights vo;
				for(int i=0;i<list.size();i++){
					vo=(AgrRights)list.get(i);
					if(vo.getParentId()==1){
						if(i>0)out.println("</div>");
						out.println("<div dojoType='dijit.layout.AccordionPane' title='"+vo.getRightName()+"'>");
					}else{
						//如果有导入实际数的权限，就是录入人员
						if(vo.getRightName().equals("导入实际数")){
							isInputPeople=true;
						}
						
						if(vo.getComment()!=null)
							out.println("<img src='"+vo.getComment()+"' border=0 height=16 width=16 />");
						else
							out.println("<img src='/images/tj-42.gif'  border=0 />");
						if(vo.getIsOld().equals("1")){//用户和权限模块采用以前的模式，所以用addTabFrame()方法
							%>
							<a class="menu" href="javascript:addTabFrame('<%=vo.getRightName()%>','<%=vo.getRightUrl()%>','<%=vo.getIsSingle()%>')"><%=vo.getRightName()%></a><br>
							<%
						}else{
							%>
							<a class="menu" href="javascript:addTab('<%=vo.getRightName()%>','<%=vo.getRightUrl()%>','<%=vo.getIsSingle()%>')"><%=vo.getRightName()%></a><br>
							<%
						}
					}					
				}
				if(list.size()>0)out.println("</div>");	
				
			%>		
		</div>
		

		<div id="tab1" dojoType="dijit.layout.ContentPane" sizeShare="75" title="欢迎页面">
			<iframe frameborder="0" name="mainFrm" id="mainFrm" width="100%" height="100%" src="/main/login/welcome.htm"></iframe>
		</div>

	</div>
</div>

<div dojoType="dijit.Dialog" id="showInforDia" title="消息">
	<div id="inforData" style="vertical-align:middle;width:200px;height:50px;text-align:center"></div>
</div>

<script>
dojo.addOnLoad(function(){
 	//如果包含导入实际数就默认打开数据管理模块，否则默认打开审批管理模块
	var m=dijit.byId("menuMain");
	var mc=m.getChildren();
	for(var i=0;i<mc.length;i++){	
		if(mc[i].title=="<%=(isInputPeople?"数据管理":"审批管理")%>")
			mc[i]._onTitleClick();
	}
 });
</script>
</body>
</html>